1. Field of the Invention
The present invention relates to a motion estimation circuit, and more particularly to a circuit for computing sums of absolute difference (SAD).
2. Description of Related Art
Generally, digital visual communication carries tremendous large amount of data. In order to save into the storage space, visual communication data and the bandwidth thereof, the visual communication data should be compressed. Data compression achieves the purpose of reducing the amount of data by removing redundant data inform the visual communication data. For example, if the last frame is similar to the next frame, the parts of the next frame similar to those of the last frame are removed and the dissimilar parts of the next frame are preserved. Accordingly, the amount of the visual communication data can be substantially reduced. For example, MPEG visual data compression standard has been widely used as a visual coding method.
When the present frame and the to-be-compared frame are compared, presently, the frame is divided into a plurality of image blocks. The typical size of image blocks is 16×16 or 8×8 pixels. One of the image blocks is selected and compared with the to-be-compared frame by a searching process. In the to-be-compared frame, the block corresponding to the present image block serves as a center, and a search region composed of pixels covering a specific distance from the center is called search window. The specific distance is called a search range. In the search window, the image block is compared to each of the to-be-compared image blocks so as to determine the block that is most similar to the image block. This process is called motion estimation.
During the comparison of the present image block and the to-be-compared image blocks, the computation of SAD for these two pixels is performed. In other words, the pixel data of the image block and the to-be-compared blocks are subtracted from each other. Then the absolute values of the computed results are obtained. The accumulation of the absolute values is the SAD of the image block and the to-be-compared block. The similarity of the image block and the to-be-compared block can be determined according to SAD.
In the prior art process, after the completion of the SAD computation, the circuit has to be reset before the next SAD computation is performed. For motion estimation requiring a large number of SAD computations, the reset step consumes significant amount of the operating time.
Presently, the prior art method cannot meet the H.264 standard with 8×16, 16×8, 8×4, 4×8 and 4×4 image block data. Moreover, the prior art method can only compute for the 16×16 or 8×8 image block data, and cannot support the tree-structure motion estimation.